<%--
  Created by IntelliJ IDEA.
  User: 金贤哲
  Date: 2017/3/22 0022
  Time: 9:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>产品查询</title>
    <meta name="decorator" content="default"/>
    <link rel="stylesheet" href="/static/modules/api/Loanfilter/style/we.css"/>
    <script src="${ctxStatic}/layer/layer.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            /**
             * @funciton  数据库 ---  编辑页面  .val(str)
             */
            function toTextarea(str){
                var reg=new RegExp("<br>","g");
                var regSpace=new RegExp("&nbsp;","g");
                str = str.replace(reg,"\n");
                str = str.replace(regSpace," ");
                return str;
            }
            $(".remarks").each(function () {
                $(this).html(toTextarea($(this).text()));
            })

        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
<shiro:hasPermission name="sys:loan:loan:getmaterialtypename"><li class="active"><a href="${ctx}/sys/loan/loan/getLoanListFilters">贷款查询列表</a></li></shiro:hasPermission>
</ul>
<form:form id="checkboxLoan" modelAttribute="loandto" action="${ctx}/sys/loan/loan/getLoanListFilters" method="post" class="form-horizontal" onsubmit="return jqchk();">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
      <c:forEach items="${materialTypes}" var="materialType">
    <div class="MeMe">
        <label class="weui-cell" for=${materialType.id}>
        <div class="weui-cell__hd">
            <input type="checkbox" class="weui-check" name="checkboxLoan" value="${materialType.id}" id=${materialType.id}>
            <i class="weui-icon-checked"></i>
        </div>

            <span class="weui-cell__bd">${materialType.name}</span>

        </label>

    </div>
      </c:forEach>
    <div class="form-actions">
        <shiro:hasPermission name="sys:loan:loan:getmaterialtypename"><input  class="btn btn-primary" type="submit" value="筛 选" /></shiro:hasPermission>
    </div>
</form:form>
<script>
 function jqchk(){ //jquery获取复选框值
     var chk_value =[];
     $('input[name="checkboxLoan"]:checked').each(function(){
         chk_value.push($(this).val());
     });
     if(chk_value.length ==0){
         alert(chk_value.length==0 ?'你还没有选择已有资料，请选择资料后做筛选！':chk_value);
         return false;
     }
 }


</script>
</html>
